#!/bin/bash

# Тест работы с различными странными грамматики из книг и статей

echo "Тесты грамматики =================================" > test/tmp/test-grammatize.out

echo "Метод разбора LR(1) ------------------------------" >> test/tmp/test-grammatize.out

for file in test/source/grammar/fuze/*.fuze
do
    echo "--- ${file} :" >> test/tmp/test-grammatize.out
    cat ${file} >> test/tmp/test-grammatize.out
    echo "--- grammatize :" >> test/tmp/test-grammatize.out
    bin/simodo-grammatize -z lr ${file} >> test/tmp/test-grammatize.out
done

echo "Метод разбора SLR(0) -----------------------------" >> test/tmp/test-grammatize.out

for file in test/source/grammar/fuze/*.fuze
do
    echo "--- ${file} :" >> test/tmp/test-grammatize.out
    cat ${file} >> test/tmp/test-grammatize.out
    echo "--- grammatize :" >> test/tmp/test-grammatize.out
    bin/simodo-grammatize -z slr ${file} >> test/tmp/test-grammatize.out
done

exit 0
